<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>回复信件</title>
    <link type="text/css" href="css/base.css" rel="stylesheet"/>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="../js/menu.js"></script>
    <script type="text/javascript">
        function topage(page) {
            var form = document.getElementById("myform");
            document.getElementById("page")
                    .setAttribute("value", page);
            form.submit();
        }
        function actionEvent() {
            var form = document.getElementById("myform");
            if (ValidateIsSelect(form.all, form.mailIds)) {
                form.action = "Mailbox!deleteMail.action";
                form.submit();
            } else {
                alert("请选择要操作的记录");
            }
        }
        /*
         *全选
         */
        function allselect(allobj, items) {
            var state = allobj.checked;
            if (items.length > 0) {
                for (var i = 0; i < items.length; i++) {
                    if (!items[i].disabled) {
                        items[i].checked = state;
                    }
                }
            } else {
                if (!items.disabled)items.checked = state;
            }
        }

        /*
         *判断是否选择了记录
         */
        function ValidateIsSelect(allobj, items) {
            if (items.length > 0) {
                for (var i = 0; i < items.length; i++) {
                    if (items[i].checked) {
                        return true;
                    }
                }
            } else {
                if (items.checked)return true;
            }
            return false;
        }

    </script>
    <!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
<%@ include file="/page/share/menu.jsp" %>

<div id="content" style="width: 1000px; margin-left: 17%;">
    <form method="post" action="Mailbox!notDealMailList.action?newsId" align="center" id="myform">
        <input type="hidden" name="page" value="1" id="page"/>
        <table align="center"
               style="margin-left:0%;margin-top:0px;width:1000px;background: #114a93;opacity:0.9;font-family: '微软雅黑',serif;color: linen;
    text-align: center">
            <thead align="center">
            <tr>
                <td style="width: 50px;"><label>
                    <input type="checkbox" name="all" onclick="allselect(this,this.form.mailIds)">
                </label></td>
                <td>姓&nbsp;名</td>
                <td>主&nbsp;题</td>
                <td>内&nbsp;容</td>
                <td>提问时间</td>
                <td>操&nbsp;作</td>
            </tr>
            </thead>
            <s:iterator value="pageView.records" var="s">
                <tr>
                    <td><label>
                        <input type="checkbox" value="${s.id}" name="mailIds">
                    </label></td>
                    <td>${s.student.studentName}</td>
                    <td>${s.title}</td>
                    <td>${s.message}</td>
                    <td><fmt:formatDate value="${s.publishDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                    <td>
                        <a href="Mailbox!replyMail.action?flag=1&id=${s.id}">回复</a>
                    </td>
                </tr>
            </s:iterator>
        </table>
        <input align="center" type="button" name="review" onclick="actionEvent()" value="删除"
               onMouseOver="this.style.background='#2569c1'"
               onmouseout="this.style.background='#114a93'"
               style="width:80px;height:30px;margin:6px 0 0 600px ;cursor:pointer;border: none;
        background: #114a93;color: white;font-size: 16px;">
        <table align="center" style="font-family: '微软雅黑',serif;text-align: center">
            <tr>
                <td colspan="4" bgcolor="#114a93" align="center" style="padding-right: 10px;width:500px;height: 20px;">
                    <%@ include file="/page/share/fenye.jsp" %>
                </td>
            </tr>
        </table>
    </form>
</div>


<div id="footer">
    <p style="text-align: center;color: #757575;padding: 20px 0px 0px 0px; font:12px;">Copyright © 2010-2013 蓝天白云团队
        版权所有</p>
</div>
</body>
</html>